package com.ly.mpayment.persist.entity;

import java.math.BigDecimal;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;


/**
 * UpOrder entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name="uporder"

)

public class UpOrder  implements java.io.Serializable {


    // Fields

     private String uporderuuid;
     private ProvincialInformation information;
     private DownRechargeFlow downRechargeFlow;
     private UpShopProduct upShopPro;
     private User userOrder;
     private String operators;
     private String upphonenum;
     // 状态 0 删除 1 充值中 2 充值成功 3充值失败  4成功后取消的订单  5订单达到  6退款成功 7 退款失败  8失败后取消的订单 10  压单  11 人工
     private int status;
     private Date createtime;
     private String statusremark;
     private String upOrderId;
     private Date upendtime;
     private String remark;
     private String province;
     private BigDecimal rechargeamount;
     private BigDecimal discount;
     private int uprechargenum;
//     private String fastchargetype;
//     private String upnotificationaddress;
//     private BigDecimal successamount;
     private String childOrder;
     private int upendtimesec;
     private int callBack;
     private String downShopName;
     private int sendStatus;
     private BigDecimal discountAmount;
     private String cityName;
    //重复提交次数
     private Integer repeatNum;
     private String operatorname;

     private String name;
     private String areaName;
     private String sourceIp;
     private String rechargeType;
     private String server;

    //     private BigDecimal deductAmount;
     private Set<UpOrderRefund> upOrderRefunds = new HashSet<UpOrderRefund>(0);
     private Set<UpOrderLog> upOrderLogs = new HashSet<UpOrderLog>(0);


    // Constructors

    /** default constructor */
    public UpOrder() {
    }


    /** full constructor */
    public UpOrder(ProvincialInformation provincialInformation, DownRechargeFlow downRechargeFlow, UpShopProduct upShopPro, User user, String upreqid, String upphonenum, int status, Date createtime, String statusremark, String uprespondid, Date upendtime, String remark, BigDecimal rechargeamount, int uprechargenum, String fastchargetype, String upnotificationaddress, BigDecimal successamount, int upendtimesec, int upreqnum, Set<UpOrderRefund> upOrderRefunds, Set<UpOrderLog> upOrderLogs) {
        this.information = provincialInformation;
        this.downRechargeFlow = downRechargeFlow;
        this.upShopPro = upShopPro;
        this.userOrder = user;
        this.upphonenum = upphonenum;
        this.status = status;
        this.createtime = createtime;
        this.statusremark = statusremark;
        this.upendtime = upendtime;
        this.remark = remark;
        this.rechargeamount = rechargeamount;
//        this.upnotificationaddress = upnotificationaddress;
        this.upendtimesec = upendtimesec;
        this.upOrderRefunds = upOrderRefunds;
        this.upOrderLogs = upOrderLogs;
    }

    public UpOrder(String uporderuuid, ProvincialInformation information, DownRechargeFlow downRechargeFlow, UpShopProduct upShopPro, User userOrder, String operators, String upphonenum, int status, Date createtime, String statusremark, String upOrderId, Date upendtime, String remark, String province, BigDecimal rechargeamount, BigDecimal discount, int uprechargenum, String childOrder, int upendtimesec, int callBack, String downShopName, int sendStatus, BigDecimal discountAmount, String cityName, Set<UpOrderRefund> upOrderRefunds, Set<UpOrderLog> upOrderLogs) {
        this.uporderuuid = uporderuuid;
        this.information = information;
        this.downRechargeFlow = downRechargeFlow;
        this.upShopPro = upShopPro;
        this.userOrder = userOrder;
        this.operators = operators;
        this.upphonenum = upphonenum;
        this.status = status;
        this.createtime = createtime;
        this.statusremark = statusremark;
        this.upOrderId = upOrderId;
        this.upendtime = upendtime;
        this.remark = remark;
        this.province = province;
        this.rechargeamount = rechargeamount;
        this.discount = discount;
        this.uprechargenum = uprechargenum;
        this.childOrder = childOrder;
        this.upendtimesec = upendtimesec;
        this.callBack = callBack;
        this.downShopName = downShopName;
        this.sendStatus = sendStatus;
        this.discountAmount = discountAmount;
        this.cityName = cityName;
        this.upOrderRefunds = upOrderRefunds;
        this.upOrderLogs = upOrderLogs;
    }

    // Property accessors
    @Id
    @GeneratedValue(generator = "uuid")
    @GenericGenerator(name = "uuid", strategy = "uuid")
    @Column(name="uporderuuid", unique=true, nullable=false, length=32)

    public String getUporderuuid() {
        return this.uporderuuid;
    }

    public void setUporderuuid(String uporderuuid) {
        this.uporderuuid = uporderuuid;
    }


	@ManyToOne(fetch=FetchType.LAZY)
        @JoinColumn(name="provinceuuid")
	public ProvincialInformation getInformation() {
		return information;
	}


	public void setInformation(ProvincialInformation information) {
		this.information = information;
	}


	@ManyToOne(fetch=FetchType.LAZY)
        @JoinColumn(name="downorderuuid")

    public DownRechargeFlow getDownRechargeFlow() {
        return this.downRechargeFlow;
    }

    public void setDownRechargeFlow(DownRechargeFlow downRechargeFlow) {
        this.downRechargeFlow = downRechargeFlow;
    }
	@ManyToOne(fetch=FetchType.LAZY)
        @JoinColumn(name="upprouuid")

    public UpShopProduct getUpShopPro() {
        return this.upShopPro;
    }

    public void setUpShopPro(UpShopProduct upShopPro) {
        this.upShopPro = upShopPro;
    }
	@ManyToOne(fetch=FetchType.LAZY)
        @JoinColumn(name="useruuid")
	 public User getUserOrder() {
		return userOrder;
	}


	public void setUserOrder(User userOrder) {
		this.userOrder = userOrder;
	}

    @Column(name = "city_name", length = 20)
    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }


//    @Column(name="upreqid", length=40)
//    public String getUpreqid() {
//        return this.upreqid;
//    }
//
//    public void setUpreqid(String upreqid) {
//        this.upreqid = upreqid;
//    }

    @Column(name="upphonenum", length=20)

    public String getUpphonenum() {
        return this.upphonenum;
    }

	public void setUpphonenum(String upphonenum) {
        this.upphonenum = upphonenum;
    }

    @Column(name="status")

    public int getStatus() {
        return this.status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    @Column(name="createtime", length=19)

    public Date getCreatetime() {
        return this.createtime;
    }

    public void setCreatetime(Date createtime) {
        this.createtime = createtime;
    }

    @Column(name="statusremark", length=40)

    public String getStatusremark() {
        return this.statusremark;
    }

    public void setStatusremark(String statusremark) {
        this.statusremark = statusremark;
    }

    @Column(name="up_order_id", length=40)
    public String getUpOrderId() {
		return upOrderId;
	}


	public void setUpOrderId(String upOrderId) {
		this.upOrderId = upOrderId;
	}


    @Column(name="upendtime", length=19)

    public Date getUpendtime() {
        return this.upendtime;
    }


	public void setUpendtime(Date upendtime) {
        this.upendtime = upendtime;
    }

    @Column(name="remark", length=1000)

    public String getRemark() {
        return this.remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Column(name="rechargeamount", precision=28, scale=5)

    public BigDecimal getRechargeamount() {
        return this.rechargeamount;
    }

    public void setRechargeamount(BigDecimal rechargeamount) {
        this.rechargeamount = rechargeamount;
    }

    @Column(name="uprechargenum")

    public int getUprechargenum() {
        return this.uprechargenum;
    }

    public void setUprechargenum(int uprechargenum) {
        this.uprechargenum = uprechargenum;
    }

//    @Column(name="fastchargetype", length=40)
//
//    public String getFastchargetype() {
//        return this.fastchargetype;
//    }
//
//    public void setFastchargetype(String fastchargetype) {
//        this.fastchargetype = fastchargetype;
//    }

//    @Column(name="upnotificationaddress", length=200)
//    public String getUpnotificationaddress() {
//        return this.upnotificationaddress;
//    }
//
//    public void setUpnotificationaddress(String upnotificationaddress) {
//        this.upnotificationaddress = upnotificationaddress;
//    }

//    @Column(name="successamount", precision=28, scale=5)
//
//    public BigDecimal getSuccessamount() {
//        return this.successamount;
//    }
//
//    public void setSuccessamount(BigDecimal successamount) {
//        this.successamount = successamount;
//    }

    @Column(name="upendtimesec")

    public int getUpendtimesec() {
        return this.upendtimesec;
    }

    public void setUpendtimesec(int upendtimesec) {
        this.upendtimesec = upendtimesec;
    }

    @Column(name="call_back")
    public int getCallBack() {
		return callBack;
	}

	public void setCallBack(int callBack) {
		this.callBack = callBack;
	}



@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="upOrder")

    public Set<UpOrderRefund> getUpOrderRefunds() {
        return this.upOrderRefunds;
    }

    public void setUpOrderRefunds(Set<UpOrderRefund> upOrderRefunds) {
        this.upOrderRefunds = upOrderRefunds;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="upOrder")

    public Set<UpOrderLog> getUpOrderLogs() {
        return this.upOrderLogs;
    }

    public void setUpOrderLogs(Set<UpOrderLog> upOrderLogs) {
        this.upOrderLogs = upOrderLogs;
    }

    @Column(name="down_shop_name")
	public String getDownShopName() {
		return downShopName;
	}


	public void setDownShopName(String downShopName) {
		this.downShopName = downShopName;
	}

	 @Column(name="send_status")
	public int getSendStatus() {
		return sendStatus;
	}


	public void setSendStatus(int sendStatus) {
		this.sendStatus = sendStatus;
	}



	 @Column(name="discount")
	public BigDecimal getDiscount() {
		return discount;
	}


	public void setDiscount(BigDecimal discount) {
		this.discount = discount;
	}

	@Column(name = "operatoruid")
	public String getOperators() {
		return operators;
	}

	public void setOperators(String operators) {
		this.operators = operators;
	}


	@Column(name = "province")
	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	@Column(name="discount_amount", precision=28, scale=5)
	public BigDecimal getDiscountAmount() {
		return discountAmount;
	}


	public void setDiscountAmount(BigDecimal discountAmount) {
		this.discountAmount = discountAmount;
	}

	@Column(name = "child_order")
	public String getChildOrder() {
		return childOrder;
	}


	public void setChildOrder(String childOrder) {
		this.childOrder = childOrder;
	}

//	@Column(name = "deduct_amount")
//	public BigDecimal getDeductAmount() {
//		return deductAmount;
//	}


//	public void setDeductAmount(BigDecimal deductAmount) {
//		this.deductAmount = deductAmount;
//	}

    @Column(name = "repeat_num")
    public Integer getRepeatNum() {
        return repeatNum;
    }

    public void setRepeatNum(Integer repeatNum) {
        this.repeatNum = repeatNum;
    }

    @Column(name = "operatorname")
    public String getOperatorname() {
        return operatorname;
    }

    public void setOperatorname(String operatorname) {
        this.operatorname = operatorname;
    }

    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Column(name = "area_name")
    public String getAreaName() {
        return areaName;
    }

    public void setAreaName(String areaName) {
        this.areaName = areaName;
    }

    @Column(name = "source_ip")
    public String getSourceIp() {
        return sourceIp;
    }

    public void setSourceIp(String sourceIp) {
        this.sourceIp = sourceIp;
    }


    @Column(name = "recharge_type")
    public String getRechargeType() {
        return rechargeType;
    }

    public void setRechargeType(String rechargeType) {
        this.rechargeType = rechargeType;
    }

    @Column(name = "server")
    public String getServer() {
        return server;
    }

    public void setServer(String server) {
        this.server = server;
    }

    @Override
	public String toString() {
		return "UpOrder [uporderuuid=" + uporderuuid  + " , upShopPro=" + upShopPro.getUpprouuid() +   ", upphonenum="
				+ upphonenum + ", status=" + status + ", createtime=" + createtime + ", statusremark=" + statusremark
				+ ", upOrderId=" + upOrderId + ", upendtime=" + upendtime + ", remark=" + remark
				+ ", rechargeamount=" + rechargeamount  +",discountAmount="+discountAmount+ ", upendtimesec=" + upendtimesec
				+ ", callBack=" + callBack + ", downShopName=" + downShopName +  ",sendStatus="+sendStatus+  ",childOrder="+childOrder+
				  "]";
	}


}
